﻿<UserControl x:Class="bLogical.GaugeControl.GaugeControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="222" Width="194" Loaded="UserControl_Loaded">
    <UserControl.Resources>

        <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
        <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
        <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
        <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD" />
        <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
        <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
        <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />
        <SolidColorBrush x:Key="GlyphBrush" Color="#444" />
        <SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />

        <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBoxBase}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="MinWidth" Value="20"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBoxBase}">
                        <Border Name="Border"
                                  CornerRadius="5" 
                                  Padding="2"
                                  Background="{StaticResource WindowBackgroundBrush}"
                                  BorderBrush="{StaticResource SolidBorderBrush}"
                                  BorderThickness="1" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Canvas Background="Transparent">
            <Image Source="Resources/Images/Gauge.png" 
                                       Height="190" 
                                       Width="189.924" 
                                       Canvas.Left="0" 
                                       Canvas.Top="0">
            </Image>
            <Image  x:Name="needle" Source="Resources/Images/needle.png" Canvas.Left="87.465" Canvas.Top="93.296" Height="77.469" Width="15.827">
                <Image.RenderTransform>
                    <RotateTransform Angle="{Binding Counter}" CenterX="8" CenterY="0" />

                </Image.RenderTransform>
            </Image>
            <Image  x:Name="avgNeedle" Source="Resources/Images/needlesmall.png" Canvas.Left="87.465" Canvas.Top="93.296" Height="77.469" Width="15.827">
                <Image.RenderTransform>
                    <RotateTransform Angle="{Binding AvgCounter}" CenterX="8" CenterY="0" />

                </Image.RenderTransform>
            </Image>
            <Image  Source="Resources/Images/round.png" Width="37.485" Canvas.Top="75.803" Canvas.Left="77.469" Height="37.485"/>
            <Label Canvas.Left="0.833" Canvas.Top="192.423" Height="32.322" Width="190.757" FontFamily="Calibri" FontSize="14">
                <TextBlock Name="lblDescription" TextAlignment="Center" Width="190">Label</TextBlock>
            </Label>

            <TextBlock Margin="63,136" Name="l1" Foreground="LightGreen" Text="0" TextAlignment="Left"/>
            <TextBlock Margin="40,115" Name="l2" Foreground="LightGreen" Text="50" TextAlignment="Left"/>
            <TextBlock Margin="35,81" Name="l3" Foreground="LightGreen" Text="100" TextAlignment="Left"/>
            <TextBlock Margin="48,49" Name="l4" Foreground="LightGreen" Text="150" TextAlignment="Left"/>
            <TextBlock Margin="72,35" Name="l5" Foreground="LightGreen" Text="200" TextAlignment="Left"/>
            <TextBlock Margin="103,35" Name="l6" Foreground="LightGreen" Text="250" TextAlignment="Left"/>
            <TextBlock Margin="112,49" Name="l7" Foreground="LightGreen" Text="300" TextAlignment="Right" Width="30" />
            <TextBlock Margin="125,81" Name="l8" Foreground="LightGreen" Text="350" TextAlignment="Right" Width="30"/>
            <TextBlock Margin="118,115" Name="l9" Foreground="LightGreen" Text="400" TextAlignment="Right" Width="30"/>
            <TextBlock Margin="99,136" Name="l10" Foreground="LightGreen" Text="450" TextAlignment="Right" Width="30" />
        </Canvas>
    </Grid>
</UserControl>
